package file;

import java.io.File;

public class ListFilesDemo {
    public static void main(String[] args) {

        /*
        isDirectory  判断是否为目录

        isFile       判断是否为文件
         */
        File dir = new File("./demo/bbb");
        if (dir.isDirectory()) {
            File[] subs = dir.listFiles();
            for (int i = 0; i < subs.length; i++) {
                System.out.println(subs[i].getName());
            }
        }
        dir.deleteOnExit();

    }
}
